/*
 * signal2.c
 *  
 * Mark Claypool, WPI
 * Fall 2011
 *
 * Show basic signal handler.
 */

#include <stdio.h>
#include <signal.h>

void CleanUp();

main() {

  /* Catch control-C is SIGINT (signal 1), INT */
  signal(SIGINT, CleanUp); 

  /* note, you cannot ignore SIGKILL (kill) and SIGSTOP (suspend) */

  while(1) {   }

}


void CleanUp()
{
   fprintf(stderr, "I can't hear you!  Na, na, na, na ...\n");
}
